package com.demo.statemachine.d20;

import lombok.extern.slf4j.Slf4j;
import org.springframework.messaging.support.MessageBuilder;
import org.springframework.statemachine.action.Action;
import reactor.core.publisher.Mono;

import java.util.concurrent.TimeUnit;

@Slf4j
public class TestActions {
    //****************************** entry action ***********************************************************
    public static Action<TestStates,TestEvents> TEST_ACTION = stateContext -> {

    };

    public static Action<TestStates,TestEvents> INTERNAL_ACTION = stateContext -> {
//        try {
//            TimeUnit.SECONDS.sleep(3);
//        } catch (InterruptedException e) {
//            e.printStackTrace();
//        }
        stateContext.getSource().sendEvent( MessageBuilder.withPayload(TestEvents.BUSY_T1_FORK).build());

    };

    public static Action<TestStates,TestEvents> ERROR_ACTION = stateContext -> {
        log.error("xxxxx---> ERROR_ACTION");
    };

    public static Action<TestStates,TestEvents> IDLE_TRANSIT_ACTION = stateContext -> {

    };
    public static Action<TestStates,TestEvents> BUSY_TRANSIT_ACTION = stateContext -> {

    };
    public static Action<TestStates,TestEvents> HISTORY_TRANSIT_ACTION = stateContext -> {

    };
    public static Action<TestStates,TestEvents> SUSPEND_TRANSIT_ACTION = stateContext -> {

    };
    public static Action<TestStates,TestEvents> FAULT_TRANSIT_ACTION = stateContext -> {

    };

    public static Action<TestStates,TestEvents> BUSY_START_TRANSIT_ACTION = stateContext -> {
        log.info("BUSY_START_TRANSIT_ACTION");
    };

    public static Action<TestStates,TestEvents> T1_FORK_TRANSIT_ACTION = stateContext -> {
        log.info("BUSY_START_TRANSIT_ACTION");
    };
    public static Action<TestStates,TestEvents> T1_TASK_TRANSIT_ACTION = stateContext -> {

    };
    public static Action<TestStates,TestEvents> T1_JOIN_TRANSIT_ACTION = stateContext -> {

    };
    public static Action<TestStates,TestEvents> T1_CHOICE_TRANSIT_ACTION = stateContext -> {

    };

    public static Action<TestStates,TestEvents> T2_FORK_TRANSIT_ACTION = stateContext -> {

    };
    public static Action<TestStates,TestEvents> T2_TASK_TRANSIT_ACTION = stateContext -> {

    };
    public static Action<TestStates,TestEvents> T2_JOIN_TRANSIT_ACTION = stateContext -> {

    };
    public static Action<TestStates,TestEvents> T2_CHOICE_TRANSIT_ACTION = stateContext -> {

    };

    public static Action<TestStates,TestEvents> T3_FORK_TRANSIT_ACTION = stateContext -> {

    };
    public static Action<TestStates,TestEvents> T3_TASK_TRANSIT_ACTION = stateContext -> {

    };
    public static Action<TestStates,TestEvents> T3_JOIN_TRANSIT_ACTION = stateContext -> {

    };
    public static Action<TestStates,TestEvents> T3_CHOICE_TRANSIT_ACTION = stateContext -> {

    };

    public static Action<TestStates,TestEvents> T4_FORK_TRANSIT_ACTION = stateContext -> {

    };
    public static Action<TestStates,TestEvents> T4_TASK_TRANSIT_ACTION = stateContext -> {

    };
    public static Action<TestStates,TestEvents> T4_JOIN_TRANSIT_ACTION = stateContext -> {

    };
    public static Action<TestStates,TestEvents> T4_CHOICE_TRANSIT_ACTION = stateContext -> {

    };

    public static Action<TestStates,TestEvents> T5_FORK_TRANSIT_ACTION = stateContext -> {

    };
    public static Action<TestStates,TestEvents> T5_TASK_TRANSIT_ACTION = stateContext -> {

    };
    public static Action<TestStates,TestEvents> T5_JOIN_TRANSIT_ACTION = stateContext -> {

    };
    public static Action<TestStates,TestEvents> T5_CHOICE_TRANSIT_ACTION = stateContext -> {

    };

    public static Action<TestStates,TestEvents> T6_FORK_TRANSIT_ACTION = stateContext -> {

    };
    public static Action<TestStates,TestEvents> T6_TASK_TRANSIT_ACTION = stateContext -> {

    };
    public static Action<TestStates,TestEvents> T6_JOIN_TRANSIT_ACTION = stateContext -> {

    };
    public static Action<TestStates,TestEvents> T6_CHOICE_TRANSIT_ACTION = stateContext -> {

    };

    public static Action<TestStates,TestEvents> T7_FORK_TRANSIT_ACTION = stateContext -> {

    };
    public static Action<TestStates,TestEvents> T7_TASK_TRANSIT_ACTION = stateContext -> {

    };
    public static Action<TestStates,TestEvents> T7_JOIN_TRANSIT_ACTION = stateContext -> {

    };
    public static Action<TestStates,TestEvents> T7_CHOICE_TRANSIT_ACTION = stateContext -> {

    };

    public static Action<TestStates,TestEvents> T8_FORK_TRANSIT_ACTION = stateContext -> {

    };
    public static Action<TestStates,TestEvents> T8_TASK_TRANSIT_ACTION = stateContext -> {

    };
    public static Action<TestStates,TestEvents> T8_JOIN_TRANSIT_ACTION = stateContext -> {

    };
    public static Action<TestStates,TestEvents> T8_CHOICE_TRANSIT_ACTION = stateContext -> {

    };

    public static Action<TestStates,TestEvents> T1_TASK1_START_TRANSIT_ACTION = stateContext -> {

    };
    public static Action<TestStates,TestEvents> T1_TASK1_END_TRANSIT_ACTION = stateContext -> {

    };

    public static Action<TestStates,TestEvents> T2_TASK1_START_TRANSIT_ACTION = stateContext -> {

    };
    public static Action<TestStates,TestEvents> T2_TASK1_END_TRANSIT_ACTION = stateContext -> {

    };

    public static Action<TestStates,TestEvents> T3_TASK1_START_TRANSIT_ACTION = stateContext -> {

    };
    public static Action<TestStates,TestEvents> T3_TASK1_END_TRANSIT_ACTION = stateContext -> {

    };

    public static Action<TestStates,TestEvents> T4_TASK1_START_TRANSIT_ACTION = stateContext -> {

    };
    public static Action<TestStates,TestEvents> T4_TASK1_END_TRANSIT_ACTION = stateContext -> {

    };

    public static Action<TestStates,TestEvents> T5_TASK1_START_TRANSIT_ACTION = stateContext -> {

    };
    public static Action<TestStates,TestEvents> T5_TASK1_END_TRANSIT_ACTION = stateContext -> {

    };

    public static Action<TestStates,TestEvents> T6_TASK1_START_TRANSIT_ACTION = stateContext -> {

    };
    public static Action<TestStates,TestEvents> T6_TASK1_END_TRANSIT_ACTION = stateContext -> {

    };

    public static Action<TestStates,TestEvents> T7_TASK1_START_TRANSIT_ACTION = stateContext -> {

    };
    public static Action<TestStates,TestEvents> T7_TASK1_END_TRANSIT_ACTION = stateContext -> {

    };

    public static Action<TestStates,TestEvents> T8_TASK1_START_TRANSIT_ACTION = stateContext -> {

    };
    public static Action<TestStates,TestEvents> T8_TASK1_END_TRANSIT_ACTION = stateContext -> {

    };

    public static Action<TestStates,TestEvents> BUSY_END_TRANSIT_ACTION = stateContext -> {

    };
}
